{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>评论-闲言轻博客</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="{% static 'lavoz/layui/css/layui.css' %}">
	<link rel="stylesheet" href="{% static 'lavoz/static/css/mian.css' %}">

</head>
<body class="lay-blog">
		<div class="header">
			<div class="header-wrap">
				<h1 class="logo pull-left">
					<a href="{% url 'lavoz:index' %}">
						<img src="{% static 'lavoz/static/images/logo.png' %}" alt="" class="logo-img">
						<img src="{% static 'lavoz/static/images/logo-text.png' %}" alt="" class="logo-text">
					</a>
				</h1>
				<form class="layui-form blog-seach pull-left" action="">
					<div class="layui-form-item blog-sewrap">
					    <div class="layui-input-block blog-sebox">
					      <i class="layui-icon layui-icon-search"></i>
					      <input type="text" name="title" lay-verify="title" autocomplete="off"  class="layui-input">
					    </div>
					</div>
				</form>
				<div class="blog-nav pull-right">
					<ul class="layui-nav pull-left">
					  <li class="layui-nav-item layui-this"><a href="{% url 'lavoz:index' %}">首页</a></li>
					  <li class="layui-nav-item"><a href="message.html">留言</a></li>
					  <li class="layui-nav-item"><a href="about.html">关于</a></li>
					</ul>
					<a href="#" class="personal pull-left">
						<i class="layui-icon layui-icon-username"></i>
					</a>
				</div>
				<div class="mobile-nav pull-right" id="mobile-nav">
					<a href="javascript:;">
						<i class="layui-icon layui-icon-more"></i>
					</a>
				</div>
			</div>
			<ul class="pop-nav" id="pop-nav">
				<li><a href="{% url 'lavoz:index' %}">首页</a></li>
				<li><a href="message.html">留言</a></li>
				<li><a href="about.html">关于</a></li>
			</ul>
		</div>
		<div class="container-wrap">
			<div class="container container-message container-details container-comment">
					<div class="contar-wrap">
                    {% autoescape off %}
						<div class="item">
							<div class="item-box  layer-photos-demo1 layer-photos-demo">
								<h3>{{ xx.title }}</h3>
								<h5>发布于：<span>{{ xx.pub_time }}</span></h5>
								{{ xx.Content }}
								<div class="count layui-clear">
									<span class="pull-left">阅读 <em>{{ xx.read_num }}</em></span>
									<span class="pull-right like"><i class="layui-icon layui-icon-praise"></i><em>{{ xx.like_num }}</em></span>
								</div>
							</div>
						</div>
                    {% endautoescape %}
						<form class="layui-form" id="my_comment" name="form1" action="{% url 'lavoz:comment' xx.id %}" method="post">
                            {% csrf_token %}
                            <input type="hidden" id="time" name="time" value="">

							<div class="layui-form-item layui-form-text">
								<textarea  name="content" form="my_comment" class="layui-textarea"  style="resize:none" placeholder="写点什么啊"></textarea>
							</div>
							<div class="btnbox">
{#									<a href="{% url 'lavoz:detail' xx.id %}"  id="sure">#}

									<a href="javascript:document.form1.submit();"  id="sure">
							  		确定
							  	</a>
							</div>
						</form>
					</div>
			</div>
		</div>
		<div class="footer">
			<p>
				<span>&copy; 2018</span>
				<span><a href="http://www.layui.com" target="_blank">layui.com</a></span> 
				<span>MIT license</span>
			</p>
			<p><span>人生就是一场修行</span></p>
		</div>

      <script>
        function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
};
        var commentTime = getNowFormatDate();
         var ss = document.getElementById('time');
        ss.value=commentTime;
    </script>
	<script src="{% static 'lavoz/layui/layui.js' %}">

	</script>
	<script>
		layui.config({
		  base: '{% static 'lavoz/static/js/' %}'
		}).use('blog');
	</script>
	<script id="LAY-msg-tpl" type="text/html">
		<div class="info-box">
			<div class="info-item">
				<img class="info-img" src="{{ d.avatar }}" alt="">
			  <div class="info-text">
					<p class="title">
					  <span class="name">{{ d.username }}</span>
					  <span class="info-img">
					  	<i class="layui-icon layui-icon-praise"></i>
					  	{{ d.praise }}
					 	</span>
					</p>
					<p class="info-intr">
						{{ d.content }}
					</p>
			  </div>
			</div>
		</div>
	</script>
</body>
</html>